home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
352_01
/
veczsum.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-22
|
542b
|
24 lines
//////// COMPLEX VECTORS
//
// sum of elements in a complex vector.
//
//
#include <stdlib.h>
#include <alloc.h>
#include <string.h>
#include "wtwg.h"
#include "dblib.h"
#include "vector.h"
complex sum (CVector& vec, int n1, int n2 )
// sum between point1 and point2 (friend function of CVector)
// if point2 == -1, sums to end of vec
{
float sreal= sum(vec.x, n1,n2);
float simag= sum(vec.y, n1,n2);
return ( complex(sreal,simag) );
}
//--------------------- end VECZSUM.CPP ---------------------